.class public Lcom/hierynomus/asn1/utils/encoders/b;
.super Ljava/lang/Object;
.source "Hex.java"


# static fields
.field private static final a:Lcom/hierynomus/asn1/utils/encoders/a;


# direct methods
.method static constructor <clinit>()V
    .locals 1

    .line 1
    new-instance v0, Lcom/hierynomus/asn1/utils/encoders/c;

    invoke-direct {v0}, Lcom/hierynomus/asn1/utils/encoders/c;-><init>()V

    sput-object v0, Lcom/hierynomus/asn1/utils/encoders/b;->a:Lcom/hierynomus/asn1/utils/encoders/a;

    return-void
.end method

.method public static a([B)[B
    .locals 2

    .line 1
    array-length v0, p0

    const/4 v1, 0x0

    invoke-static {p0, v1, v0}, Lcom/hierynomus/asn1/utils/encoders/b;->a([BII)[B

    move-result-object p0

    return-object p0
.end method

.method public static a([BII)[B
    .locals 2

    .line 2
    new-instance v0, Ljava/io/ByteArrayOutputStream;

    invoke-direct {v0}, Ljava/io/ByteArrayOutputStream;-><init>()V

    .line 3
    :try_start_0
    sget-object v1, Lcom/hierynomus/asn1/utils/encoders/b;->a:Lcom/hierynomus/asn1/utils/encoders/a;

    invoke-interface {v1, p0, p1, p2, v0}, Lcom/hierynomus/asn1/utils/encoders/a;->a([BIILjava/io/OutputStream;)I
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    .line 4
    invoke-virtual {v0}, Ljava/io/ByteArrayOutputStream;->toByteArray()[B

    move-result-object p0

    return-object p0

    :catch_0
    move-exception p0

    .line 5
    new-instance p1, Lcom/hierynomus/asn1/utils/encoders/EncoderException;

    new-instance p2, Ljava/lang/StringBuilder;

    invoke-direct {p2}, Ljava/lang/StringBuilder;-><init>()V

    const-string v0, "exception encoding Hex string: "

    invoke-virtual {p2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {p0}, Ljava/lang/Exception;->getMessage()Ljava/lang/String;

    move-result-object v0

    invoke-virtual {p2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {p2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object p2

    invoke-direct {p1, p2, p0}, Lcom/hierynomus/asn1/utils/encoders/EncoderException;-><init>(Ljava/lang/String;Ljava/lang/Throwable;)V

    throw p1
.end method
